import http from '../../utils/request/request'

export function getMaterialInfoBypage(page=1,size=5) {
    return http({
        url:`/processing/processing-material-enter-info/?no=${page}&size=${size}&dateStrPre=&dateStrAft`,
        method: 'get'
    })
}

export function getsupplierInfoBypage(data) {
    return http({
        url:`/processing/processing-supplier/supplier`,
        method: 'get',
        data
    })
}

export function getMaterialName(data) {
    return http({
        url:`/processing/processing-material/allName`,
        method: 'get',
        data
    })
}


export function addMaterialInfo(data) {
    return http({
        url: '/processing/processing-material-enter-info/',
        method: 'post',
        data
    })
}

export function editMaterialInfo(data) {
    return http({
        url: '/processing/processing-material-enter-info/',
        method: 'put',
        data
    })
}

export function delMaterialInfo(id) {
    return http({
        url: `/processing/processing-material-enter-info/?id=${id}`,
        method: 'delete'
    })
}

export function detailMaterialInfo(data) {
    return http({
        url: '/processing/processing-material-enter-info/detail',
        method: 'get',
        data
    })
}

//通过时间范围、sku、进厂类型分页查看原料进口登记信息
export function getMaterialInfoByTime(no=1,size=5,startTime,endTime) {
    return http({
        url: `/processing/processing-material-enter-info/?no=${no}&size=${size}&dateStrPre=${startTime}&dateStrAft=${endTime}`,
        method: 'get',
    })
}
